import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './assets/reset.css'
import * as echarts from 'echarts'
// 基于准备好的dom，初始化echarts实例
// 绘制图表
import {
  Container, Header, Aside, Main, Menu, Submenu, MenuItemGroup,
  MenuItem, Breadcrumb, BreadcrumbItem, Avatar, Tag, Input, Button,
  Table, TableColumn, Switch, Pagination, Dialog, MessageBox, Message,
  Drawer, Form, FormItem, Select, Option, DatePicker, Col, CheckboxGroup, RadioGroup,
  Radio, Checkbox, Tooltip, Steps, Step, Upload, Cascader, Row, Dropdown, DropdownMenu,
  DropdownItem
} from 'element-ui'
// 引入弹窗
const { alert, confirm, prompt } = MessageBox
Vue.prototype.$alert = alert
Vue.prototype.$confirm = confirm
Vue.prototype.$prompt = prompt
Vue.prototype.$message = Message
Vue.prototype.$echarts = echarts
Vue.config.productionTip = false

Vue.use(Container)
  .use(Header)
  .use(Aside)
  .use(Main)
  .use(Menu)
  .use(Submenu)
  .use(MenuItemGroup)
  .use(MenuItem)
  .use(Breadcrumb)
  .use(BreadcrumbItem)
  .use(Avatar)
  .use(Tag)
  .use(Input)
  .use(Button)
  .use(Table)
  .use(TableColumn)
  .use(Switch)
  .use(Pagination)
  .use(Dialog)
  .use(Drawer)
  .use(Form)
  .use(FormItem)
  .use(Select)
  .use(Option)
  .use(DatePicker)
  .use(Col)
  .use(CheckboxGroup)
  .use(RadioGroup)
  .use(Radio)
  .use(Checkbox)
  .use(Tooltip)
  .use(Steps)
  .use(Step)
  .use(Upload)
  .use(Cascader)
  .use(Row)
  .use(Dropdown)
  .use(DropdownMenu)
  .use(DropdownItem)
new Vue({
  router,
  store,
  created() {
    if (sessionStorage.getItem('newRouter')) {
      store.commit('authority/INIT_ROUTER', JSON.parse(sessionStorage.getItem('newRouter')))
    }
  },
  render: h => h(App)
}).$mount('#app')
